﻿using OnLineExam.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using HHG.Common;
using OnLineExam.Web.Service;

namespace OnLineExam.Web.api
{
	/// <summary>
	/// PaperHandler 的摘要说明
	/// </summary>
	public class PaperHandler : IHttpHandler
	{
		private OnLineExam.BLL.PaperManager _bll;
		public void ProcessRequest(HttpContext context)
		{
			_bll = new BLL.PaperManager();
			context.Response.ContentType = "application/Json";

			var paperID = context.Request.QueryString["id"].GetInt();
			 

			var paperViewModel = PaperHelper.GetPaperViewModel(paperID);


			context.Response.Write(paperViewModel.SerializeObject());

		}

		public bool IsReusable
		{
			get
			{
				return false;
			}
		}
	}
}